package com.demo.service.impl;

import com.demo.entity.RoleMenu;
import com.demo.mapper.RoleMenuMapper;
import com.demo.service.RoleMenuService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RoleMenuServiceImpl implements RoleMenuService {
    @Autowired
    private RoleMenuMapper mapper;
    @Override
    public int Delete(String RoleId) {
        return mapper.Delete(RoleId);
    }

    @Override
    public int Insert(RoleMenu roleMenu) {
        return mapper.Insert(roleMenu);
    }

    @Override
    public PageInfo<RoleMenu> list(int pageIndex, int pageSize) {
        PageHelper.startPage(pageIndex,pageSize);
        return new PageInfo<>(mapper.list());
    }
}
